#include "heap.hpp"
#include <time.h>

using namespace std;
void printTopK(const vector<int>& a, int n, int k)
{
	minHeap heap;
	for (int i = 0; i < n; i++)
	{
		heap.push(a[i]);
		if (heap.getSize() > k)
		{
			heap.pop();
		}
	}
	while (!heap.empty())
	{
		cout << heap.top() << " ";
		heap.pop();
	}
	cout << endl;
}

int main()
{
	int n = 50000;
	vector<int> a(50000);
	srand(time(0));
	for (int i = 0; i < n; i++)
	{
		a[i] = rand() % 100000;
	}
	a[68] = 100001;
	a[217] = 100002;
	a[3405] = 100003;
	a[6040] = 100004;
	printTopK(a, 50000, 10);
}